package com.solomiao.demo.multi.thread.demo10;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class MainDemo103 {
    private static final Logger LOGGER = LoggerFactory.getLogger(MainDemo103.class);

    public static void main(String[] args) throws InterruptedException {
        TimedWaitigRunnable timedWaitigRunnable = new TimedWaitigRunnable();
        Thread t1 = new Thread(timedWaitigRunnable);
        t1.start();
        Thread.sleep(1000);
        LOGGER.info("t1线程的状态：" + t1.getState().toString());
        Thread.sleep(3000);
        LOGGER.info("t1线程的状态：" + t1.getState().toString());
    }

    static class TimedWaitigRunnable implements Runnable {
        @Override
        public void run() {
            LOGGER.info("等待线程开始运行");
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            LOGGER.info("等待线程运行完成");
        }
    }
}
